home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 4
/
United Public Domain Gold 4.iso
/
fredfish
/
ff.0164.dms
/
ff.0164.adf
/
Newton
/
decl.h
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-22
|
782b
|
38 lines
/* decl.h: Declarations for the "Newton" program.
*
* Written by Daniel Barrett. 100% PUBLIC DOMAIN. */
#include <stdio.h>
#include <math.h>
#ifdef UNIX
#define BOOL short
#define TRUE 1
#define FALSE 0
#else
#include <exec/types.h>
#endif
#define MAX_DEGREE 20 /* Maximum degree of equation. */
#define MAX_ITERATIONS 10000
#define EPSILON_DEFAULT 0.0000001
#define EQUAL !strcmp
#define SQR(x) ((x)*(x))
struct ComplexNumber { /* One complex number. */
double n[2]; /* Real & imaginary parts. */
};
typedef struct ComplexNumber complex;
#define REAL 0 /* 1st element of ComplexNumber. */
#define IMAG 1 /* 2nd element of ComplexNumber. */
/* If C is of type "complex", then:
*
* C.n[REAL] is the real part.
* C.n[IMAG] is the imaginary part.
*
*/